package com.java.second_goods.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 订单对象 tb_booking
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("tb_booking")
public class Booking extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 订单ID */
    @TableId(value = "id", type = IdType.INPUT)
    private String id;

    /** 用户ID */
    private Integer userId;


    /** 商品ID */
    private Integer goodsId;

    /** 预约日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date bookingDate;

    /** 预约时间 */
    @JsonFormat(pattern = "HH:mm:ss")
    private Date bookingTime;

    /** 服务地址 */
    private String address;

    /** 联系人姓名 */
    private String contactName;

    /** 联系人电话 */
    private String contactPhone;


    /** 特殊需求 */
    private String requirements;


    /** 优惠金额 */
    private BigDecimal discount;

    /** 总金额 */
    private BigDecimal totalAmount;

    /** 使用的优惠券ID */
    private Integer couponId;

    /** 订单状态：pending-待确认,confirmed-已确认,preparing-准备中,inService-服务中,completed-已完成,canceled-已取消 */
    private String status;

    /** 是否已评价 */
    private Boolean hasReviewed;

    /** 取消时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date cancelTime;
}